package com.sjb.sixteen_journey_backend.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sjb.sixteen_journey_backend.entity.vo.UserBaseMsgVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 私聊表
 * </p>
 *
 * @author jcz
 * @since 2024-08-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("chat_list")
public class ChatList implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 私聊表id
     */
    @TableId(value = "chat_list_id", type = IdType.AUTO)
    private Integer chatListId;

    /**
     * 私聊内容
     */
    @TableField("content")
    private String content;

    /**
     * 发送者id
     */
    @TableField("from_user_id")
    private Integer fromUserId;

    /**
     * 发送者名字
     */
    @TableField("from_name")
    private String fromName;

    /**
     * 发送者头像
     */
    @TableField("from_avatar")
    private String fromAvatar;

    /**
     * 接收者id
     */
    @TableField("to_user_id")
    private Integer toUserId;

    /**
     * 接收者姓名
     */
    @TableField("to_name")
    private String toName;


    /**
     * 接收者头像
     */
    @TableField("to_avatar")
    private String toAvatar;

    /**
     * 发送时间
     */
    @TableField(value = "postdate",fill = FieldFill.INSERT)
    private LocalDateTime postdate;

    /**
     * 发送内容类型
     */
    @TableField("type")
    private String type;

    /**
     * 是否已读,默认为未读（0）
     */
    @TableField("is_Looked")
    private Boolean isLooked;

//    @TableField(exist = false)
//    @JsonIgnore
//    private UserBaseMsgVo fromUser;
//
//    @TableField(exist = false)
//    @JsonIgnore
//    private UserBaseMsgVo toUser;
}
